package com.ruoyi.web.core.config;


import com.github.wxpay.sdk.WXPayConfig;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

/**
 * 天蛙小程序配置信息
 * @author zdh
 * @date 2020-06-29
 */
@Slf4j
public class TimvvaConfig extends WechatConfig{
    /**
     * 接口加密  00157bf809ee3f8b
     */
    public static final String KDC = "00157bf809ee3f8b";

    /**
     * 小程序appId
     */
    public static final String APPID = "wxd602e0793295cc28";

    /**
     * 小程序密钥
     */
    public static final String SECRET = "7ec0b59e73b75b7388bd0323f1d29955";

    /**
     * 商户号
     */
    public static final String MCHID = "1600285034";

    /**
     * 商户密钥 --- 同 API V3 密钥
     */
    public static final String KEY = "345a533400157bf809ee3f8b4953eafa";

    /**
     * API V3 秘钥
     */
    public static final String API_V3_KEY = "345a533400157bf809ee3f8b4953eafa";


    public static final String BODY = "智能物联";

    public static final  String DESC = "智能物联分润到账";

    /**
     * 小程序服务号
     */
    public static final String SERVICE_ID = "00002000000000160024998230485964";

    /**
     * 支付分签名方式
     */
    public static final String SIGN_TYPE = "HMAC-SHA256";

    /**
     * 金额环回说明
     */
    public static final String REFUND_DESC = "智能物联，余额退还";

    /**
     * 商户api证书序列号
     * https://myssl.com/cert_decode.html 证书解析地址
     */
    public static final String SERIAL_NO = "7943274AD416AF3C291ED11950842D69F56D5A73";

    /**
     * 证书内容  apiclient_key.pem文件中的内容 除去开头结尾行
     *  请求量大为节约资源直接拿出来
     */
    public static final String PRIVATE_CONTENT = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCl/IccW5jilTdL" +
            "kJ4cPAmfub2cfCr5qAkELkU9i0wMOKtqXC/mpb5Y5kjd9fTLGogEbNC0bSAE7bG8" +
            "gNqWaabiHFIIy8Ga1CUMFrSGwDMkKtQHf5gwPAa9wo6yiqQ+Ndry6HXWI3FsW4aK" +
            "s/VZ8btgFIzyIl0XCMn7WfgJu8D9odKEDo+i3ovKRUweCxcfvh0GnASYf0iGUQU9" +
            "1pN4ThTdkD96tVWCNlVZ+rU9Dp8DWe9RKwsZ1wIExtxb/0yWR1kW3MdvVdrylXQO" +
            "iSH4yqtb15L9sZ26ThCywpMHr5il2PWF/MjcIVgLDQttDCkezxI96RD5pZEluwAk" +
            "JyaxeEgXAgMBAAECggEAT3DrIVFdfKQ50LqoUY8SdBWrgCeVUeNwXUXf8bKndPny" +
            "YHc6ncMZtOaSXVkIDeTm0GdcA95ugq1YcYWiGHb8Xh97y6XpRTbffEepowx97YNp" +
            "8yTIK92uxEdHkH/2V6fi4HsNWq2f7WJopB25AZFGQpfTVVfJAes88EWBBveLSFfT" +
            "EgGZp57ua9M3bMRySUSlddbNg6IGZJg2podYVao/qYOXgI414E1HJ8CWkijL1//b" +
            "5uV1R1G0zz+BmS75doqjnlXqUFEqS+jYF2l0xpOlJ+OfNPEixNArl2m9BD6tf0fV" +
            "ujfcTERmJ3p64fT2Jd77zwKL7r9BMAOnQeNw/91pIQKBgQDZwvF7BpWWd2Z43IhL" +
            "4HI95nZb1wET16IPLOPYIA3AqI1MHNMimbORFbhAP9Y6321+Mh2HS4IaTncS4WNw" +
            "8qaXwIwjZIvcHKcNb1wvoToYiUvXSUHqhkwdkPbksdqTBGy/A8dAYlQuG9rfVfmH" +
            "777TtWGrSasj5kziRWs4NGrb6QKBgQDDIiJryKneuddnePqZYa6jedNk/mpr7pnY" +
            "SUfA3sBb4YoqW+1YHxY8nFfBo0Rji9MTe+wAYUAoMrnh3EiN6TrphHcPkAI1UH6R" +
            "tqb+x7xa5vn0zKx9oVFcHHrLhYxFSszB9YViDKhNV0Cl7Kpz6YhnSvyboC8Nz48Y" +
            "jWe6bCeD/wKBgQCyDukNw7CFPFSZ9xmrkXdYjh2xsvi6lNN6vSYBDxSvuCLxXZB2" +
            "9l8R/0SNpKUztoX9blUez+suP4K1+X4qWP9HjrYIKqsB7JvcLHagq6Cpd3qAKvKv" +
            "JekPM/3tulATbsbM2fYO+1gB69zoSZCkSrEqw2F9gdtim2m6izDE4HeQIQKBgGQd" +
            "JzvVgBHdlz5nO2tmSotk/ahbP46QpC3rqvyxTE/Xr2N8NpF3oZkHPZ8DfRr1qh3c" +
            "/oBTZO8611OiCTeF6cvVQqChagCgg8+Ovq8JGwIobyXBvN3X3j47/mRc6FLExbjd" +
            "lslvZQoJMgnvGqTNtEYKmv/dd0bGrswSAJ4Mz1lRAoGBANE7xbhvw3mN/GkfRd6g" +
            "cRLXnngtbkiXxMsMPdiH+wMYSGUV2DxireNaav2onfDi4mpGyNaccxIJy20Cexdz" +
            "mD5jw54EMfzXLInNjIiwG2+hOFczS0CzEM977Uq4j7XDFCSVRUzgloodU2F7+O6v" +
            "wUOaWxM2aLdFqlzJmW45xKsP";

    @Override
    public String getAppid() {
        return APPID;
    }

    @Override
    public String getSecret() {
        return SECRET;
    }

    @Override
    public String getMchId() {
        return MCHID;
    }

    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public String getApiV3Key() {
        return API_V3_KEY;
    }

    @Override
    public String getBody() {
        return BODY;
    }

    @Override
    public String getDesc() {
        return DESC;
    }

    @Override
    public String getServiceId() {
        return SERVICE_ID;
    }

    @Override
    public String getSignType() {
        return SIGN_TYPE;
    }

    @Override
    public String getRefundDesc() {
        return REFUND_DESC;
    }

    @Override
    public String getSerialNo() {
        return SERIAL_NO;
    }

    @Override
    public String getPrivateContent() {
        return PRIVATE_CONTENT;
    }

    @Override
    public WXPayConfig getWXPayConfig() {
        try {
            return new TimvvaPayConfig();
        } catch (IOException e) {
            log.error("【error】：天蛙商户配置文件初始化失败" +e.getMessage(), e);
        }
        return null;
    }
}
